class Searchquery < ActiveRecord::Base
  def self.query_issued(query)
    begin
      obj = find_by_query query
      obj.count += 1
      obj.save
    rescue
      Searchquery.create(:query => query, :count => '1')
    end
  end
end
